package lxh.com.union.logic_business.present;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.HttpHeaders;
import com.lzy.okgo.model.HttpParams;
import com.lzy.okgo.model.Response;

import java.lang.reflect.Type;
import java.util.List;

import lxh.com.union.config.SinlliaConfig;
import lxh.com.union.frame.mvp.BasePresent;
import lxh.com.union.logic_business.model.bean.BaseBean;
import lxh.com.union.logic_business.model.bean.LoginBean;
import lxh.com.union.logic_business.model.bean.OrderCountBean;
import lxh.com.union.logic_business.model.net.INetCallBack;
import lxh.com.union.logic_business.model.net.MyCallBack;
import lxh.com.union.logic_business.model.net.UrlConstant;
import lxh.com.union.logic_business.ui.mvpview.IMineView;
import lxh.com.union.logic_business.util.LogUtils;
import lxh.com.union.logic_business.util.SharePrefUtils;
import lxh.com.union.logic_business.util.ToastUtils;

/**
 * Created by Administrator on 2017/11/28.
 */

public class MinePresent extends BasePresent<IMineView> {

    public void loadOrderCount(){
        OkGo.<String>get(UrlConstant.ORDER_COUNT)
                .params("memberId", SharePrefUtils.getString(SinlliaConfig.IIDD))
                .headers(SinlliaConfig.TOKEN,SharePrefUtils.getString(SinlliaConfig.TOKEN))
                .tag(this).execute(new MyCallBack(OrderCountBean.class, new INetCallBack() {
            @Override
            public void success(Object o) {
                getView().getOrderCount((OrderCountBean) o);
            }

            @Override
            public void failed(Object o) {
                ToastUtils.showLong(o.toString());
            }
        }));

    }

}
